<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin t&iacute;tulo</title>
<script language="javascript" src="../myClass/MyClass.js"></script>
<script language="javascript" src="IndicadorGeneral.js"></script>
</head>

<body>

<div id="tablero_content" style="width:100%; text-align:center; overflow:hidden"> 
   <table align="center" width="600" cellspacing="0" cellpadding="0"="" border="1px">
      <tr>
      	<td width="160">
        	<table>
            	<tr><td>Alimentacion:</td><td id="alimentacion">apagada</td></tr>
                <tr><td>Aceite:</td><td id="aceite">apagada</td></tr>
                <tr><td>Baliza:</td><td id="baliza">apagada</td></tr>
            </table>
        </td>
        <td width="120" height="100" bgcolor="#1F1A17" id="posIndicadorGeneral" align="center"></td>
        <td width="160"></td>
      </tr>	
      <tr>
      	<td></td>
        <td><input name="" value="cambiar" type="button" onclick="change();" /></td>
        <td></td>
      </tr>	
   </table>
</div>

<script type="text/javascript">
	var leds = new IndicadorGeneral('images/');
	leds.putDisplayIn('posIndicadorGeneral');
	
	function aleatorio(){  
    	aleat = Math.random() * 2; 
	    aleat = Math.floor(aleat); 
		if (aleat==1)
			return true;		
    	return false; 
	} 
	
	function change(){
		var alimentacion = aleatorio();
		var aceite = aleatorio(); 
		var baliza = aleatorio();
		document.getElementById('alimentacion').innerHTML = ((alimentacion)?'encendida':'apagada');
		document.getElementById('aceite').innerHTML = ((aceite)?'encendida':'apagada');
		document.getElementById('baliza').innerHTML = ((baliza)?'encendida':'apagada');
		leds.setValues(alimentacion,aceite,baliza);
	}
			
</script>

</body>
</html>
